package com.cucn.ingmall.auth.feign;

import com.cucn.common.utils.R;
import com.cucn.ingmall.auth.vo.MemberRegistVO;
import com.cucn.ingmall.auth.vo.SocialUser;
import com.cucn.ingmall.auth.vo.UserLoginVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author KouChaoJie
 * @since: 2022/1/10 17:43
 */
@FeignClient("ingmall-member")
public interface MemberFeignService {
    /**
     * 用户注册方法
     *
     * @param registVO 认证服务传过来的用户注册信息
     * @return
     */
    @PostMapping("/member/member/regist")
    public R regist(@RequestBody MemberRegistVO registVO);

    /**
     * 用户登录方法
     *
     * @param loginVO 登录vo
     * @return
     */
    @PostMapping("/member/member/login")
    public R login(@RequestBody UserLoginVO loginVO);

    /**
     * 用户社交登录方法
     *
     * @param socialUser 社交用户回调信息(token)
     * @return
     */
    @PostMapping("/member/member/oauth2/login")
    public R login(@RequestBody SocialUser socialUser) throws Exception;
}
